import request from '@/utils/request.js'

// 手机号一件登录
export const phoneLogin = (data) => {
  return request({
    url: '/api/wx/PhoneLogin',
    method: 'post',
    data
  })
}
// 普通登录
export const login = (data) => {
  return request({
    url: '/api/wx/Login',
    method: 'post',
    data
  })
}
// 车辆录入是否重复
export const carRedo = (data) => {
  return request({
    url: '/api/VehicleInfo/GetVINList',
    method: 'get',
    data
  })
}
// 添加车辆
export const addcar = (data) => {
  return request({
    url: '/api/VehicleInfo/Add',
    method: 'post',
    data
  })
}
// 获取可签署的合同列表
export const getSignableContractList = (data) => {
  return request({
    url: '/api/template/GetCamera',
    method: 'get',
    data
  })
}
// 获取合同列表 id
export const getContratList = (data) => {
  return request({
    url: '/api/Order/GetSHUserIdList',
    method: 'get',
    data
  })
}
// 获取某个合同的详情
export const getContratDetails = (data) => {
  return request({
    url: '/api/EQB/GetTemplateDC',
    method: 'get',
    data
  })
}
// 获取待审核合同列表 id
export const getCheckPendingContratList = (data) => {
  return request({
    url: '/api/Order/GetSHList',
    method: 'get',
    data
  })
}

// 获取个人模板数据 id
export const getPersonalTemplateList = (data) => {
  return request({
    url: '/api/Member/GetInfo',
    method: 'get',
    data
  })
}
// 添加个人模板数据 memberId 用户id name 标签名称 value 模板值
export const addPersonalTemplate = (data) => {
  return request({
    url: '/api/Member/AddInfo',
    method: 'post',
    data
  })
}
// 删除个人合同模板
export const delPersonalTemplate = (data) => {
  return request({
    url: '/api/Member/DelInfo',
    method: 'post',
    data
  })
}
// 更新合同状态
export const updateContrat = (data) => {
  return request({
    url: '/api/Order/Edit',
    method: 'post',
    data
  })
}
// 修改密码 id用户id  pwd密码
export const changePassword = (data) => {
  return request({
    url: '/api/Member/UpdatePwd',
    method: 'get',
    data
  })
}
// 上传文件
export const uploadFile = (data) => {
  return request({
    url: '/api/EQB/UploadFile',
    method: 'post',
    data
  })
}
// 添加文件 - 检测
export const addFile = (data) => {
  return request({
    url: '/api/VehicleJCPhoto/AddList',
    method: 'post',
    data
  })
}
// 添加文件 - 整备
export const addFileZB = (data) => {
  return request({
    url: '/api/VehiclePhoto/Add',
    method: 'post',
    data
  })
}
// 获取车辆列表
export const getCGINIT = (data) => {
  return request({
    url: '/api/VehicleInfo/GetCGINIT',
    method: 'get',
    data
  })
}
// 获取车辆列表
export const getCGINITEND = (data) => {
  return request({
    url: '/api/VehicleInfo/GetCGINITEND',
    method: 'get',
    data
  })
}
// 更新车辆的状态 - 删除
export const updateCarStatus = (data) => {
  return request({
    url: '/api/VehicleInfo/Edit',
    method: 'post',
    data
  })
}
// 待检测列表 - 待检测
export const getJCINIT = (data) => {
  return request({
    url: '/api/VehicleInfo/getJCINIT',
    method: 'get',
    data
  })
}
// 待检测列表 - 已检测
export const getJCList = (data) => {
  return request({
    url: '/api/VehicleInfo/GetJCList',
    method: 'get',
    data
  })
}
// 驳回列表
export const getCGBH = (data) => {
  return request({
    url: '/api/VehicleInfo/GetCGBH',
    method: 'get',
    data
  })
}
// 待检测-整备-列表 - 详情
export const getVehcileIdOne = (data) => {
  return request({
    url: '/api/VehicleInfo/GetVehcileIdOne',
    method: 'get',
    data
  })
}
// 待检测列表 - 详情 - 图片
export const getVehicleJCPhoto = (data) => {
  return request({
    url: '/api/VehicleJCPhoto/GetVehcileIdList',
    method: 'get',
    data
  })
}
// 删除图片
export const deleteVehicleJCPhoto = (data) => {
  return request({
    url: '/api/VehicleJCPhoto/Remove',
    method: 'post',
    data
  })
}
// 整备列表 - 待整备
export const getZBINIT = (data) => {
  return request({
    url: '/api/VehicleInfo/GetZBINIT',
    method: 'get',
    data
  })
}
// 整备列表 - 已整备
export const getZBList = (data) => {
  return request({
    url: '/api/VehicleInfo/GetZBList',
    method: 'get',
    data
  })
}
// 整备详情 - 图片
export const getVehcileIdListVehiclePhoto = (data) => {
  return request({
    url: '/api/VehiclePhoto/GetVehcileIdList',
    method: 'get',
    data
  })
}

// 整备详情 - 删除图片
export const deleteVehiclePhoto = (data) => {
  return request({
    url: '/api/VehiclePhoto/Remove',
    method: 'post',
    data
  })
}

export const GetListVehicleInfo = (data) => {
  return request({
    url: '/api/VehicleInfo/GetList',
    method: 'get',
    data
  })
}
export const getListOverVehicleInfo = (data) => {
  return request({
    url: '/api/VehicleInfo/GetListOver',
    method: 'get',
    data
  })
}
// 维保记录查询参考 - 车辆详情
export const getListMaintainRecord = (data) => {
  return request({
    url: '/api/VehicleInfo/GetInfoAll',
    method: 'get',
    data
  })
}
// 维保记录查询参考 - 列表
export const getListMaintainRecordList = (data) => {
  return request({
    url: '/api/VehicleBYLS/GetVehcileIdList',
    method: 'get',
    data
  })
}
// 威佳整备记录
export const getListWJZB = (data) => {
  return request({
    url: '/api/VehiclePhoto/GetOVerList',
    method: 'get',
    data
  })
}
// 获取pdf
export const getPDF = (data) => {
  return request({
    url: '/api/EQB/GetURL',
    method: 'get',
    data
  })
}
// 获取合同驳回列表
export const getContractRejections = (data) => {
  return request({
    url: '/api/Order/GetBHUserIdList',
    method: 'get',
    data
  })
}

// 设置模板合同 也就是发起各个合同的第一步
/**
 * components:[]
 * createTime:1752204195000
 * docTemplateId:6f126796095a44b6ad426451a64481bb
 * docTemplateName:销售合同_test_test_test_test_test_test_test_test_test_test_test_test
 * fileDownloadUrl:'https://oss.esign.cn/esign-oss-release/59a7eaa1-4d4'
 * fileId:
 * fileName:销售合同_test_test_test_test_test_test_test_test_test_test_test_test
 * signFlowDescription:
 * signFlowId:
 * signFlowStatus:
 * updateTime:
 */
export const setTemplateDC = (data) => {
  return request({
    url: '/api/EQB/SetTemplateDC',
    method: 'post',
    data
  })
}
// 设置模板合同 也就是发起各个合同的第二步
/**
 * fileId:a76a30255b8e418496a24f7382506a37
 * fileUrl:'https://oss.esign.cn/esign-oss-release/59a7eaa1-4d4'
 * memberId:55
 * name:test
 * pdfId:6f126796095a44b6ad426451a64481bb
 * phone:
 * title:销售合同_test_test_test_test_test_test_test_test_test_test_test_test
 */
export const addTemplateDC = (data) => {
  return request({
    // url: '/api/Order/Add',
    url: '/api/Order/AddEntity',
    method: 'post',
    data
  })
}

// =================
export const getTemplateDC = (docTemplateId) => {
  return request({
    url: `/api/EQB/GetTemplateDC?docTemplateId=${docTemplateId}`,
    method: 'get'
  })
}
export const sendTemplateDC = (data) => {
  return request({
    url: '/api/EQB/SendTemplateDC',
    method: 'post',
    data
  })
}
